﻿var showad = true;
var Toppx = 0; //上端位置
//    var AdDivW = 100; //宽度
//    var AdDivH = 360; //高度
//    var PageWidth = 800; //这个参数决定是否出现左右滚动条
var MinScreenW = 1024; //显示广告的最小屏幕宽度象素

var cillHeight = document.documentElement.clientHeight;
var imgHeight = document.getElementById("leftImage").style.height.replace("px", "");
if (cillHeight > imgHeight) {
    Toppx = (cillHeight - imgHeight) / 2;
}

function scall() {
    if (!showad) { return; }
    if (window.screen.width < MinScreenW) {
        alert("临时提示：\n\n显示器分辨率宽度小于" + MinScreenW + ",不显示广告");
        showad = false;
        document.getElementById("LeftDiv").style.display = "none";
        document.getElementById("RightDiv").style.display = "none";
        return;
    }
    //        var Borderpx = ((window.screen.width - PageWidth) / 2 - AdDivW) / 2;
    var Borderpx = 6;
    document.getElementById("LeftDiv").style.display = "";
    document.getElementById("LeftDiv").style.top = document.documentElement.scrollTop + Toppx;
    document.getElementById("LeftDiv").style.left = document.documentElement.scrollLeft + Borderpx;
    document.getElementById("RightDiv").style.display = "";
    document.getElementById("RightDiv").style.top = document.documentElement.scrollTop + Toppx;
    document.getElementById("RightDiv").style.left = document.documentElement.scrollLeft + document.documentElement.clientWidth - document.getElementById("RightDiv").offsetWidth - Borderpx;
}

function hidead() {
    showad = false;
    document.getElementById("LeftDiv").style.display = "none";
    document.getElementById("RightDiv").style.display = "none";
    //        document.getElementById("tableOne").style.width = "100%";
}
var hidvalue = document.getElementById("hidCouPleZt").value;
if (hidvalue == "1") {
    window.onscroll = scall;
    window.onresize = scall;
    window.onload = scall;

    //        var leftdlWidth = document.getElementById("leftImage").style.width.replace("px", "");
    //        var rightdlwidth = document.getElementById("rightImage").style.width.replace("px", "");
    //        var allWidth = document.documentElement.clientWidth;
    //        document.getElementById("tableOne").style.width = (allWidth - leftdlWidth - rightdlwidth - 12 - 10) + "px";
}